﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using NextCMS.Models;

/// <summary>
/// Summary description for PageContentController
/// </summary>
public class PageContentsHelper : IDisposable
{
    IPageContent pageContents = null;
    public PageContentsHelper()
    {
        pageContents = (IPageContent)NextCMS.DataAccess.Entities.CreateInstance<IPageContent>();
        //pageContents = new NextCMS.DataAccess.PageContents();
    }
    public PageContentModel GetById(int id, int LanguageId)
    {
        return pageContents.GetById(id, LanguageId);
    }
    public IEnumerable<PageContentModel> GetAll(int LanguageId)
    {
        return pageContents.GetAll(LanguageId);
    }
    public IEnumerable<PageContentModel> GetGeneralContents(int LanguageId)
    {
        return pageContents.GetGeneralContents(LanguageId);
    }
    public int Save(PageContentModel page)
    {
        return pageContents.Save(page);
    }
    // Delete Record
    public void Delete(int id)
    {
        pageContents.Delete(id);
    }

    // Edit Record
    public void Edit(PageContentModel page)
    {
        pageContents.Edit(page);
    }
    public void Dispose()
    {
        pageContents.Dispose();
        pageContents = null;
    }
}